package vistas;

import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.JComboBox;
import javax.swing.JSpinner;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JTable;
import com.toedter.calendar.JDateChooser;
import javax.swing.JSeparator;
import javax.swing.ImageIcon;

public class AltaFactura extends JInternalFrame {
	private JTextField txtFac;
	private JComboBox cbxCodArt;
	private JComboBox cbxNombre;
	private JTable table;

	/**
	 * Create the frame.
	 */
	public AltaFactura() {
		setFrameIcon(new ImageIcon(AltaFactura.class.getResource("/recursos/MODIFICARt.png")));
		setIconifiable(true);
		setClosable(true);
		setTitle("Alta/Consulta factura");
		setBounds(100, 100, 901, 470);
		getContentPane().setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setLayout(null);
		panel.setBounds(0, 0, 552, 391);
		getContentPane().add(panel);
		
		JLabel lblNumFac = new JLabel("N\u00FAmero de Factura");
		lblNumFac.setBounds(20, 20, 110, 14);
		panel.add(lblNumFac);
		
		JLabel lblCliente = new JLabel("Nombre cliente");
		lblCliente.setBounds(20, 57, 77, 14);
		panel.add(lblCliente);
		
		JLabel lblComercial = new JLabel("Nombre vendedor");
		lblComercial.setBounds(297, 57, 96, 14);
		panel.add(lblComercial);
		
		JLabel lblFechFac = new JLabel("Fecha Factura");
		lblFechFac.setBounds(297, 20, 96, 14);
		panel.add(lblFechFac);
		
		txtFac = new JTextField();
		txtFac.setToolTipText("N\u00FAmero de la factura");
		txtFac.setColumns(10);
		txtFac.setBounds(124, 17, 150, 20);
		panel.add(txtFac);
		
		JComboBox cBoxCom = new JComboBox();
		cBoxCom.setToolTipText("Nombre del vendedor");
		cBoxCom.setBounds(392, 54, 150, 20);
		panel.add(cBoxCom);
		
		JLabel lblCdigoDeArtculo = new JLabel("Familia art\u00EDculo");
		lblCdigoDeArtculo.setBounds(20, 116, 110, 14);
		panel.add(lblCdigoDeArtculo);
		
		cbxCodArt = new JComboBox();
		cbxCodArt.setToolTipText("Familia del art\u00EDculo");
		cbxCodArt.setBounds(124, 113, 266, 20);
		panel.add(cbxCodArt);
		
		JLabel lblNombre = new JLabel("Nombre art\u00EDculo");
		lblNombre.setBounds(20, 156, 86, 14);
		panel.add(lblNombre);
		
		cbxNombre = new JComboBox();
		cbxNombre.setToolTipText("Nombre del art\u00EDculo");
		cbxNombre.setBounds(124, 153, 266, 20);
		panel.add(cbxNombre);
		
		JLabel lblCantidad = new JLabel("Cantidad");
		lblCantidad.setBounds(20, 194, 67, 14);
		panel.add(lblCantidad);
		
		JSpinner spinCant = new JSpinner();
		spinCant.setToolTipText("Unidades del art\u00EDculo");
		spinCant.setBounds(124, 191, 46, 20);
		panel.add(spinCant);
		
		JComboBox cmBxCli = new JComboBox();
		cmBxCli.setToolTipText("Nombre del cliente");
		cmBxCli.setBounds(124, 54, 150, 20);
		panel.add(cmBxCli);
		
		JLabel lblNotas = new JLabel("Notas");
		lblNotas.setBounds(20, 260, 46, 14);
		panel.add(lblNotas);
		
		JDateChooser dateChooser = new JDateChooser();
		dateChooser.setBounds(447, 14, 95, 20);
		panel.add(dateChooser);
		
		JSeparator separator = new JSeparator();
		separator.setBounds(20, 100, 522, 2);
		panel.add(separator);
		
		JSeparator separator_1 = new JSeparator();
		separator_1.setBounds(20, 231, 522, 2);
		panel.add(separator_1);
		
		JLabel lblUnidades = new JLabel("Unidades");
		lblUnidades.setBounds(180, 194, 46, 14);
		panel.add(lblUnidades);
		
		JButton btnAnadir = new JButton("A\u00F1adir a lista...");
		btnAnadir.setToolTipText("A\u00F1adir a la lista de art\u00EDculos");
		btnAnadir.setBounds(413, 111, 129, 109);
		panel.add(btnAnadir);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(124, 255, 418, 118);
		panel.add(scrollPane);
		
		JTextArea textArea = new JTextArea();
		textArea.setToolTipText("Notas de facturaci\u00F3n");
		scrollPane.setViewportView(textArea);
		
		JPanel pnlBtn = new JPanel();
		pnlBtn.setBounds(0, 396, 891, 34);
		getContentPane().add(pnlBtn);
		
		JButton btnGuard = new JButton("Guardar");
		btnGuard.setIcon(new ImageIcon(AltaFactura.class.getResource("/recursos/save.png")));
		btnGuard.setToolTipText("Guardar");
		pnlBtn.add(btnGuard);
		
		JButton btnImprimir = new JButton("Imprimir");
		btnImprimir.setIcon(new ImageIcon(AltaFactura.class.getResource("/recursos/printer.png")));
		btnImprimir.setToolTipText("Imprimir");
		pnlBtn.add(btnImprimir);
		
		JButton btnCanc = new JButton("Cancelar");
		btnCanc.setIcon(new ImageIcon(AltaFactura.class.getResource("/recursos/CANCEL.png")));
		btnCanc.setToolTipText("Cancelar");
		pnlBtn.add(btnCanc);
		
		JPanel pnlList = new JPanel();
		pnlList.setBounds(562, 0, 320, 391);
		getContentPane().add(pnlList);
		
		JLabel lblListadoDeArtculos = new JLabel("Listado de art\u00EDculos ");
		
		JScrollPane scrollTabla = new JScrollPane();
		scrollTabla.setToolTipText("Listado de los art\u00EDculos");
		GroupLayout gl_pnlList = new GroupLayout(pnlList);
		gl_pnlList.setHorizontalGroup(
			gl_pnlList.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_pnlList.createSequentialGroup()
					.addGroup(gl_pnlList.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_pnlList.createSequentialGroup()
							.addGap(112)
							.addComponent(lblListadoDeArtculos))
						.addComponent(scrollTabla, GroupLayout.PREFERRED_SIZE, 319, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		gl_pnlList.setVerticalGroup(
			gl_pnlList.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_pnlList.createSequentialGroup()
					.addGap(13)
					.addComponent(lblListadoDeArtculos)
					.addGap(18)
					.addComponent(scrollTabla, GroupLayout.DEFAULT_SIZE, 335, Short.MAX_VALUE)
					.addContainerGap())
		);
		
		table = new JTable();
		scrollTabla.setColumnHeaderView(table);
		pnlList.setLayout(gl_pnlList);

	}
}
